package com.xinqi.common.base.error;

import com.xinqi.common.base.constants.C.HttpStatus;

import static com.xinqi.common.base.error.ErrorDetail.with;

/**
 * 常见的错误,自定义的错误可通过继承该接口以便于操作
 *
 * @author linkai
 * @date 2022/11/25
 */
@SuppressWarnings("unused")
public interface CommonErrors extends ErrorDetail {

    ErrorDetail FORBIDDEN = with(HttpStatus.FORBIDDEN, "拒绝访问");

    ErrorDetail UNAUTHORIZED = with(HttpStatus.UNAUTHORIZED, "未授权访问");

    ErrorDetail NOT_FOUND = with(HttpStatus.NOT_FOUND, "内容未找到");

    ErrorDetail BAD_REQUEST = with(HttpStatus.BAD_REQUEST, "错误的请求");

    ErrorDetail NOT_IMPLEMENTED = with(HttpStatus.NOT_IMPLEMENTED, "操作未实现");

    ErrorDetail CONFLICT = with(HttpStatus.CONFLICT, "操作冲突");

    ErrorDetail NOT_ACCEPTABLE = with(HttpStatus.NOT_ACCEPTABLE, "不可接收的请求");

    ErrorDetail METHOD_NOT_ALLOWED = with(HttpStatus.METHOD_NOT_ALLOWED, "请求方法不支持");

    ErrorDetail INTERNAL_SERVER_ERROR = with(HttpStatus.INTERNAL_SERVER_ERROR, "服务内部错误");

    ErrorDetail UNSUPPORTED_MEDIA_TYPE = with(HttpStatus.UNSUPPORTED_MEDIA_TYPE, "不支持的请求类型");

    ErrorDetail NOT_DATA = with(HttpStatus.NOT_DATA, "数据已被删除");

}
